package main

import (
	"github.com/gin-contrib/sessions"
	"github.com/gin-contrib/sessions/cookie"
	"github.com/gin-gonic/gin"

	"demo0606/routers"
)

func main() {
	r := gin.Default()
	r.Static("/static", "./static")
	r.LoadHTMLGlob("templates/*")
	store := cookie.NewStore([]byte("lyf4086"))
	r.Use(sessions.Sessions("mysession", store))
	routers.InitRouteLogin(r)
	routers.InitRoutes(r)
	routers.InitRoutesNoAuth(r)
	r.Run()
}
